home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / lib / X11 / config / scoLib.rules < prev    next >
Text File  |  1995-07-17  |  11KB  |  336 lines

  1. XCOMM $XConsortium: scoLib.rules,v 1.8 91/07/19 15:38:53 rws Exp $
  2. /* 
  3.  *    @(#) scoLib.rules 12.1 95/05/09 
  4.  * SCO library rules, includes shared lib rules
  5.  *
  6.  * SCO Modification History 
  7.  * S026, 27-Jul-94, garyh, SCO-59-3684
  8.  *    InstallSharedLibrary() rule now handles DLLs, and
  9.  *    InstallStaticSharedLibrary() rule handles static shared libs.
  10.  * S025, 18-Apr-94, garyh
  11.  *    Don't need the conditional check for S024 since $(RM) includes the force option
  12.  * S024, 15-Apr-94, garyh
  13.  *    Removed old symlink to libAPI.so (if it exist)
  14.  * S023, 14-Apr-94, garyh
  15.  *    Removed DLLCCPATH
  16.  * S022, 02-Feb-94, garyh
  17.  *    Added SharedLibraryDLLTarget() rule
  18.  * S021, 06-Oct-93, kylec
  19.  *    Add InstallAppDefaultsSubDir()
  20.  * S021, 05-Oct-93, wing
  21.  *    Deleted the rules that I put in. Found a better place for them
  22.  * S020, 03-Oct-93, wing
  23.  *    Added WSLinkSourceFile rule.
  24.  * S019, 18-Jan-93, hess
  25.  *    appstartup rule needs destdir variable 
  26.  * S018, 18-Dec-92, hess
  27.  *     add appstartup install rule
  28.  * S017, 21-Sep-92, hess
  29.  *     don't build mkshlib, back out S011
  30.  *
  31.  * S016, 20-sep-92, mikep
  32.  *    move notsharedobjects rule from Library.tmpl to here
  33.  * S015, 05-Aug-92, hess
  34.  *     make the shared libs depend on the .a instead of the _s 
  35.  *    in the case of an error building the library, it will still re-try
  36.  * S014, 20-Jul-92, hess
  37.  *    modify normalLibrules2 and 3 to build in steps, this avoids the make
  38.  *     errro "$? list too long".  The hardcoded limit on dependencies is 
  39.  *     2500 chars per rule.
  40.  * S013, 16-Jun-92, hess
  41.  *     add install.runtime for installing shared lib target files.  
  42.  * S012, 15-Jun-92, hess
  43.  *     add extractobject 
  44.  * S011, 02-Jun-92, hess
  45.  *     add rule to build MKSHLIB, if it's not there. When a clean is 
  46.  *     done, util is made after lib/X... This fix is similar to the one 
  47.  *    used to build makedepend if it's not there.
  48.  * S010, 18-Mar-92, hess
  49.  *     tweak Normallib rules to run an MCS command, (see scoLib.tmpl)
  50.  *     in general we want to delete any comments in the objects.
  51.  * S009, 18-Mar-92, hess
  52.  *     fix install shared lib rule 
  53.  * S008, 12-Feb-92, hess
  54.  *    clean up shared libs rule, remove the touchfile before making a new
  55.  *     lib.
  56.  * S007, 11-Feb-92, hess
  57.  *     remove the touch file before calling mkshlib 
  58.  * S006, 10-Feb-92, hess
  59.  *    when a new libX11_s.a is made touch a file to let us know when 
  60.  *     it was done.
  61.  * S005, 10-Feb-92, hess
  62.  *    only append objs if the lib is already there 
  63.  * S004, 10-Feb-92, hess
  64.  *     add rule to install shared libs. 
  65.  * S003, 06-Feb-92, hess
  66.  *    add normallibrarytarget5 for Xlib. 
  67.  * S002, 30-Jan-92, hess
  68.  *    add libcLeandir to workaround argv too long for rm. 
  69.  * S001, 17-Jan-92, hess
  70.  *    add normallibrarytarget4 for Xlib, it's too big to build with target3
  71.  * S000, 10-Jan-92, hess
  72.  *     created  
  73.  */
  74.  
  75. #ifndef HasSharedLibraries
  76. #define HasSharedLibraries YES
  77. #endif
  78. #ifndef SharedDataSeparation
  79. #define SharedDataSeparation NO
  80. #endif
  81. #ifndef SharedCodeDef
  82. #define SharedCodeDef /**/
  83. #endif
  84. #ifndef SharedLibraryDef
  85. #define SharedLibraryDef -DSHARELIB -DUSL_COMPAT
  86. #endif
  87. #ifndef ShLibIncludeFile
  88. #define ShLibIncludeFile <scoLib.tmpl>
  89. #endif
  90. #ifndef SharedLibraryLoadFlags
  91. #define SharedLibraryLoadFlags /**/ 
  92. #endif
  93. #ifndef PositionIndependentCFlags
  94. #define PositionIndependentCFlags -KPIC
  95. #endif
  96.  
  97. /*
  98.  * Concat4 - concatenates four strings.
  99.  */
  100. #ifndef Concat4
  101. #if __STDC__ && !defined(UnixCpp)
  102. #define Concat4(a,b,c,d)a##b##c##d
  103. #else
  104. #define Concat4(a,b,c,d)a/**/b/**/c/**/d
  105. #endif
  106. #endif
  107.  
  108. /*
  109.  * InstallSharedLibrary - generate rules to install the shared library.
  110.  */
  111.  
  112. #ifndef InstallSharedLibrary
  113. #define    InstallSharedLibrary(libname,rev,dest)                @@\
  114. install.runtime::  Concat4(lib,libname,.so.,rev)            @@\
  115.     MakeDir($(DESTDIR)/usr/lib)                    @@\
  116.     $(INSTALL) -c $(INSTBINFLAGS) Concat4(lib,libname,.so.,rev) $(DESTDIR)/usr/lib
  117.  
  118. #endif /* InstallSharedLibrary */
  119.  
  120. /*
  121.  * InstallStaticSharedLibrary - generate rules to install the static shared library.
  122.  */
  123. #ifndef InstallStaticSharedLibrary
  124. #define    InstallStaticSharedLibrary(libname,rev,dest)            @@\
  125. install:: Concat3(lib,libname,_s.a)                        @@\
  126.     MakeDir($(DESTDIR)/usr/lib)                    @@\
  127.     $(INSTALL) -c $(INSTLIBFLAGS) Concat3(lib,libname,_s.a) $(DESTDIR)/usr/lib    @@\
  128. install.runtime::  Concat4(lib,libname,rev,_s)                          @@\
  129.         MakeDir($(DESTDIR)/shlib)                                       @@\
  130.         $(INSTALL) -c $(INSTBINFLAGS) Concat4(lib,libname,rev,_s) $(DESTDIR)/shlib
  131.  
  132. #endif /* InstallStaticSharedLibrary */
  133.  
  134. /*
  135.  * InstallSharedLibraryData - generate rules to install the shared library data
  136.  */
  137. #ifndef InstallSharedLibraryData
  138. #define    InstallSharedLibraryData(libname,rev,dest)
  139. #endif /* InstallSharedLibraryData */
  140.  
  141.  
  142. /*
  143.  * StaticSharedLibraryTarget - generate rules to create a shared library;
  144.  * the touch rule at the end of this mkshilb is to allow the Append 
  145.  * rule below to know when a new libX11_s.a has been built ( we can't 
  146.  * test against the target lib because it's built before the .a, and 
  147.  * we can't test against itself because this is a predecessor circle.)
  148.  */
  149. #ifndef StaticSharedLibraryTarget
  150. #define StaticSharedLibraryTarget(libname,rev,solist,down,up)        @@\
  151. AllTarget(Concat3(lib,libname,_s.a))                    @@\
  152.                                     @@\
  153. Concat3(lib,libname,_s.a):: specfile solist                @@\
  154.     $(RM) Concat4(lib,libname,_s.a,_is_new)             @@\
  155.     $(RM) Concat4(lib,libname,rev,_s~) Concat3(lib,libname,_s.a~)    @@\
  156.     -$(MV) Concat4(lib,libname,rev,_s) Concat4(lib,libname,rev,_s~)    @@\
  157.     -$(MV) Concat3(lib,libname,_s.a) Concat3(lib,libname,_s.a~)    @@\
  158.     $(MKSHLIB) -q -s specfile -t Concat4(lib,libname,rev,_s) -h $@     @@\
  159.     [ -f Concat3(lib,libname,_s.a) ] && \                @@\
  160.         touch Concat4(lib,libname,_s.a,_is_new)         @@\
  161.                                     @@\
  162. clean::                                    @@\
  163.     $(RM) Concat4(lib,libname,rev,_s) Concat3(lib,libname,_s.a) \    @@\
  164.         Concat4(lib,libname,_s.a,_is_new)
  165.  
  166. #endif /* StaticSharedLibraryTarget */
  167.  
  168. /* S22
  169.  * SharedLibraryTarget - generate rules to create a DLL shared library;
  170.  *    To get around the insufficient env space when building Xlib, there
  171.  *      is an indirection in building the shared DLL library.  When that
  172.  *    problem is (ever) fix, I'll clean up the code (garyh@sco.com).
  173.  *
  174.  */
  175. #ifndef SharedLibraryTarget
  176. #define SharedLibraryTarget(libname,rev,solist,down,up)              @@\
  177. AllTarget(Concat4(lib,libname,.so.,rev))                                @@\
  178.                                                                         @@\
  179. Concat4(lib,libname,.so.,rev):: solist                     @@\
  180.     (cd down && $(MAKE) -f ../Makefile $@.indirect)            @@\
  181.     $(MV) down/$@ $@                        @@\
  182.     $(RM) Concat(lib,libname.so)                    @@\
  183.     $(LN) $@ Concat(lib,libname.so)                    @@\
  184.                                     @@\
  185. Concat4(lib,libname,.so.,rev).indirect::                 @@\
  186.     $(CC) SharedDLLObjOptions Bl8EnvInd $(PICFLAGS) -o Concat4(lib,libname,.so.,rev) solist @@\
  187.                                                                         @@\
  188. clean::                                                                 @@\
  189.         $(RM) Concat4(lib,libname,.so.,rev)                 @@\
  190.         $(RM) Concat3(lib,libname,.so)                     @@\
  191.  
  192. #endif /* SharedLibraryTarget */
  193.  
  194.  
  195. /*
  196.  * SharedLibraryTargetAppend - generate rules to append to a shared library;
  197.  */
  198. #ifndef SharedLibraryTargetAppend
  199. #define SharedLibraryTargetAppend(libname,appendlist)            @@\
  200. AllTarget(Concat3(lib,libname,_s.a))                    @@\
  201.                                     @@\
  202. Concat3(lib,libname,_s.a):: appendlist Concat4(lib,libname,_s.a,_is_new)@@\
  203.     [ -f $@ ] && $(AR) $@ appendlist                @@\
  204.     RanLibrary($@)
  205.  
  206. #endif /* SharedLibraryTargetAppend */
  207.  
  208. /*
  209.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  210.  */
  211. #ifndef SharedLibraryDataTarget
  212. #define SharedLibraryDataTarget(libname,rev,salist)
  213. #endif /* SharedLibraryTarget */
  214.  
  215. /*
  216.  * NamedLibraryTarget - generate rules to create a library withou prepending
  217.  *      lib to the library name and remove comments via mcs(CP)
  218.  */
  219. #ifndef NamedLibraryTarget
  220. #define    NamedLibraryTarget(libname,objlist)                @@\
  221. AllTarget(libname.a)                            @@\
  222.                                     @@\
  223. libname.a: objlist                            @@\
  224.     $(RM) $@                            @@\
  225.     $(MCS) objlist                          @@\
  226.     $(AR) $@ objlist                        @@\
  227.     RanLibrary($@)
  228. #endif /* NamedLibraryTarget */
  229.  
  230. /*
  231.  * NormalLibraryTarget - generate rules to create a library.
  232.  *    and remove comments via mcs(CP)
  233.  */
  234. #ifndef NormalLibraryTarget
  235. #define    NormalLibraryTarget(libname,objlist)                @@\
  236. AllTarget(Concat(lib,libname.a))                    @@\
  237.                                     @@\
  238. Concat(lib,libname.a): objlist                        @@\
  239.     $(RM) $@                            @@\
  240.     $(MCS) objlist                          @@\
  241.     $(AR) $@ objlist                        @@\
  242.     RanLibrary($@)
  243. #endif /* NormalLibraryTarget */
  244.  
  245.  
  246. /*
  247.  * NormalLibraryTarget2 - generate rules to create a library in two steps.
  248.  * This is used to create libraries with large numbers of files.
  249.  *    and remove comments via mcs(CP)
  250.  */
  251. #ifndef NormalLibraryTarget2
  252. #define    NormalLibraryTarget2(libname,objlist1,objlist2)            @@\
  253. AllTarget(Concat(lib,libname.a))                    @@\
  254.                                     @@\
  255. Concat(lib,libname.a):: objlist1                     @@\
  256.     $(RM) $@                            @@\
  257.     $(MCS) objlist1                         @@\
  258.     $(AR) $@ objlist1                        @@\
  259. Concat(lib,libname.a):: objlist2                     @@\
  260.     $(MCS) objlist2                         @@\
  261.     $(AR) $@ objlist2                        @@\
  262.     RanLibrary($@)
  263. #endif /* NormalLibraryTarget2 */
  264.  
  265.  
  266. /*
  267.  * NormalLibraryTarget3 - generate rules to create a library in three steps.
  268.  * This is used to create libraries with very large numbers of files.
  269.  * for SCO we also and remove COFF comments via mcs(CP)
  270.  */
  271. #ifndef NormalLibraryTarget3
  272. #define    NormalLibraryTarget3(libname,objlist1,objlist2,objlist3)    @@\
  273. AllTarget(Concat(lib,libname.a))                    @@\
  274.                                     @@\
  275. Concat(lib,libname.a):: objlist1                     @@\
  276.     $(RM) $@                            @@\
  277.     $(MCS) objlist1                         @@\
  278.     $(AR) $@ objlist1                        @@\
  279. Concat(lib,libname.a):: objlist2                     @@\
  280.     $(MCS) objlist2                         @@\
  281.     $(AR) $@ objlist2                        @@\
  282. Concat(lib,libname.a):: objlist3                     @@\
  283.     $(MCS) objlist3                         @@\
  284.     $(AR) $@ objlist3                        @@\
  285.     RanLibrary($@)
  286. #endif /* NormalLibraryTarget3 */
  287.  
  288.  
  289. /*
  290.  * LibCleanDir - helper for cleaning library object subdirectories
  291.  * This failed when the arg list was too long for /bin/sh, 
  292.  * not we just use echo *.o|xargs 
  293.  * hess@sco.com
  294.  */
  295. #ifndef LibCleanDir
  296. #define LibCleanDir(dir) -@if [ -d dir ]; then \            @@\
  297.         (set -x; cd dir; echo *.o |xargs $(RM)); else exit 0; fi
  298. #endif
  299.  
  300.  
  301. /* ExtractObject - get an object out of one archive and leave it in 
  302.  * the current directory.
  303.  * NOTE: we cannot use $(AR), as this is for building archives
  304.  */
  305. #ifndef ExtractObject
  306. #define ExtractObject(obj,archive)                      @@\
  307. obj: archive                                @@\
  308.     ar xv $? $@ 
  309. #endif
  310.  
  311. /* to build objects in a shared lib dir, that will never be shared */
  312. #ifndef NotSharedObjects
  313. #define NotSharedObjects(objs)                        @@\
  314. objs:                                    @@\
  315.     _DebuggedObjCompile($(_NOOP_))                    @@\
  316.     _ProfiledObjCompile($(_NOOP_))                    @@\
  317.     _NormalObjCompile($(_NOOP_))                    @@\
  318.  
  319. #endif
  320.  
  321. #ifndef InstallAppStartup
  322. #define InstallAppStartup(class)                    @@\
  323. install::    class.as                        @@\
  324.     MakeDir($(DESTDIR)$(STARTUPDIR))                @@\
  325.     $(INSTALL) -c $(INSTALLAPPFLAGS) class.as $(DESTDIR)$(STARTUPDIR)/class    @@\
  326.  
  327. #endif
  328.  
  329. #ifndef InstallAppDefaultsSubDir
  330. #define InstallAppDefaultsSubDir(src,dst,dir)                @@\
  331. install::    src                             @@\
  332.     MakeDir($(DESTDIR)$(XAPPLOADDIR)/dir)                @@\
  333.     $(INSTALL) -c $(INSTAPPFLAGS) src $(DESTDIR)$(XAPPLOADDIR)/dir/dst    @@\
  334.  
  335. #endif
  336.